<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="2">
        <el-dropdown>
          <span class="el-dropdown-link">
            下拉菜单<i class="el-icon-caret-bottom" />
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item disabled>双皮奶</el-dropdown-item>
            <el-dropdown-item divided>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </el-col>
      <el-col :span="6">
        <el-input :value="value" aria-placeholder="请输入搜索关键词" placeholder="请输入搜索关键词" @input="handleInput" />
      </el-col>
      <el-col :span="16">
        <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: [String],
      required: true
    }
  },
  methods: {
    handleInput(value) {
      this.$emit('input', value)
    },
    handleSearch() {
      this.$emit('search', this.value)
    }
  }
}
</script>
